package com.tiger.project.service.impl;

import com.tiger.project.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * @Author bai
 * Date on 2022/12/4  20:30
 * Description:合同模板生成PDF实现方法
 */
@Service
public class reportServiceImpl implements ReportService {

    @Autowired
    private ReportUtil reportUtil;

    /**
     * 生成合同模板PDF
     *
     * @param ids
     */
    @Override
    public void generateReport(Long[] ids, Long deptId, String type) throws IOException {
        for (Long id : ids) {
            if ("3".equals(type)) {
                reportUtil.getReport1(id, deptId, type);
                reportUtil.getReport2(id,deptId,type);
            }else if ("1".equals(type)){
                reportUtil.getReport1(id, deptId, type);
                reportUtil.getReport2(id,deptId,type);
            }
        }
    }
}
